﻿Imports System.Data
Imports System.Data.Odbc
Imports WSEntidades
Imports Utilerias
Imports Npgsql
Imports MySql.Data.MySqlClient
Public Class FamiliasFact
    Public Shared Function Build(ByVal dr As MySqlDataReader) As FamiliasBE
        Dim tmpFamilias As FamiliasBE = New FamiliasBE()
        Try
            With tmpFamilias
                '.IdEmpresa = convertDTFromDb.convertInt32(dr.Item("IdEmpresa"))
                .IdFamilia = convertDTFromDb.convertInt32(dr.Item("IdFamilia"))
                .ClaFamilia = convertDTFromDb.ConvertString(dr.Item("ClaFamilia"))
                .DesFamilia = convertDTFromDb.ConvertString(dr.Item("DesFamilia"))
                Select Case convertDTFromDb.ConvertString(dr.Item("Status"))
                    Case "A"
                        .Status = FamiliasBE.EstatusFamilias.Activa
                    Case "I"
                        .Status = FamiliasBE.EstatusFamilias.Inactiva
                    Case Else
                        .Status = FamiliasBE.EstatusFamilias.Inactiva
                End Select
            End With
            Return tmpFamilias
        Catch ex As Exception
            Throw
        Finally
            tmpFamilias = Nothing
        End Try
    End Function

End Class
